abstract class TestCase extends Illuminate\Foundation\Testing\TestCase { protected $baseUrl = 'http://localhost'; public function createApplication() { $app = require __DIR__.'/../bootstrap/app.php'; $app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); // when using sqlite, allow foreign keys if (DB::connection() instanceof Illuminate\Database\SQLiteConnection) { DB::statement(DB::raw('PRAGMA foreign_keys=1')); } return $app; } }